/*
 * @Author: your name
 * @Date: 2022-03-03 09:22:43
 * @LastEditTime: 2022-03-03 09:33:57
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE.a
 * @FilePath: \JS\day05\2-数据属性.js
 */

var obj={
    name :'kjp',
    age:12
}
obj.name='larry';
delete obj.age;
for (let key in obj){
    console.log(key,obj[key],'可枚举属性')
}
console.log(obj,'默认属性可以修改可以删除')

Object.defineProperty(obj,'name',{
    configurable:false, //是否可删除
    writable:true,       //是否可修改
    enumerable:true ,  //是否可枚举属性
    value:'zhangshan'

})
console.log(obj);